class Person implements Cloneable{
    public String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}



public class TestDemo2 {


    public static void main(String[] args) {
        System.out.println("before.......");
        try {
            System.out.println(10/0);
        }catch (NullPointerException e) {
            //底层这个代码 是使用其他的 工具来打印的 不是用  System.out.println
            e.printStackTrace();
            System.out.println("我来处理 ArithmeticException 异常了！ ");
        }catch (Exception e) {
            e.printStackTrace();
            System.out.println("我来处理 NullPointerException 异常了！ ");
        }
        System.out.println("after........");
    }

    public static void main8(String[] args) {
        System.out.println("before.......");
        try {
            System.out.println(10/0);
            //System.out.println("fsfafsafsa");
        }catch (NullPointerException | ArithmeticException e) {
            //底层这个代码 是使用其他的 工具来打印的 不是用  System.out.println
            e.printStackTrace();
            System.out.println("我来处理 ArithmeticException 异常了！ ");
        }
        System.out.println("after........");
    }





    public static void func() throws CloneNotSupportedException{
        int a = 10;
        if(a == 10) {
            throw new CloneNotSupportedException("hahaha!");
        }
    }

    public static void main7(String[] args){
        try {
            func();
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }

    public static void main6(String[] args)  throws CloneNotSupportedException {
        Person person1 = new Person("zhangsan");
        Person person2 = (Person)person1.clone();

    }



    public static void main1(String[] args) {
        //func();
        //System.out.println(10/0);
        /*int[] array = null;
        System.out.println(array[0]);*/

       int[] array = {1,2,3,4};
        System.out.println(array[10]);
        System.out.println("abcd"); /**/
    }
}